-
Notifications
You must be signed in to change notification settings - Fork 166
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
movetest: add test_moving_modules_lazy_import #732
base: master
Are you sure you want to change the base?
movetest: add test_moving_modules_lazy_import #732
Conversation
@@ -341,7 +353,7 @@ def is_import_statement(self, offset): | |||
line_start = self._get_line_start(last_import) | |||
return ( | |||
self._find_import_end(last_import + 7) >= offset | |||
and self._find_word_start(line_start) == last_import | |||
and self._find_next_word_start(line_start) == last_import |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, this didn't break any tests (the only 3 failing ones are autoimports-related, and they fail on master too), and has fixed the ones I introduced. I'm still not sure I understood the original code correctly though
ee74d62
to
36b19ed
Compare
I observed some issues with "lazy" E AssertionError: 'def import_later():\n from pkg2.pkg3.p[77 chars]hing' != 'import pkg2.pkg3.pkg4.mod4\ndef import_la[109 chars]hing'
E + import pkg2.pkg3.pkg4.mod4
E def import_later():
E - from pkg2.pkg3.pkg4 import mod4
E ? -----------
E + from pkg import mod4
E from pkg2.pkg3.pkg4.mod4 import thing
E
E - mod4
E + pkg2.pkg3.pkg4.mod4
E thing
ropetest/refactor/movetest.py:639: AssertionError Where the task was to move |
I can rebase, shall I? |
Hi @SomeoneSerge, we usually use a merge-based workflow, so a rebase is not usually necessary and I don't usually do a rebase before merging. But if the PR have too many re-merges with |
Adds a failing test case for #731:
Description
Please include a summary of the change and which issue is fixed.
Related: #731 (only partial fix, the extra import is still added)
Checklist (delete if not relevant):